Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Use factory pattern to determine which scanner to use#129

Merged
arr0ganc3s merged 1 commit intoWayneKeenan:mainfrom
schang1146:sc/scanner-pattern
Sep 3, 2025
Merged

Use factory pattern to determine which scanner to use#129
arr0ganc3s merged 1 commit intoWayneKeenan:mainfrom
schang1146:sc/scanner-pattern

Conversation

@schang1146
Copy link
Contributor

Thank you for your contribution to the ClintonCAT repo.
Before submitting this PR, please make sure:


  • The target of this PR is the main branch.
  • No commits are missing from forked base branch (e.g. modified main branch instead of dev)
  • You have squashed commits that might be considered: 'noisy' or partial, e.g. not candidates for cherry picking
  • All test pass, run npm test
  • The code is formatted, run npm run format
  • You have updated or added test cases, as/if required
  • You have installed and tried out the plugin in a supported browser

Moving towards a factory pattern to figure out which scanner to use in what scenario.

For this PR, the goal was to:

  • try to keep as much existing functionality as possible
    • next steps: include product and product line URLs in the URL scanning
    • there should be some hierarchy where if the company Wiki page is not as well filled out but a product is matched and it has a corresponding company, it should find that company
  • use the Amazon scanner if it matches on a certain criteria
    • for now, I'm just checking if the user is on a product page via it's URL but there can be helper methods written to better determine that via the contents or something
  • default to using the URL scanner if no other scanner should be used

Copy link
Collaborator

@arr0ganc3s arr0ganc3s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@arr0ganc3s arr0ganc3s merged commit db6aa28 into WayneKeenan:main Sep 3, 2025
1 check passed
@schang1146 schang1146 deleted the sc/scanner-pattern branch September 4, 2025 01:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants